package com.woniuxy.utils;

import java.util.Random;

public class RandomNumberUtil {
    public static String getRandomNumber(int length){
        StringBuilder builder = new StringBuilder();
        Random random = new Random();
        for (int i = 0; i < length; i++) {
            int num = random.nextInt(10);
            builder.append(num);
        }
        System.out.println("验证码为："+builder.toString());
        return builder.toString();
    }
}
